package com.example.activitytest;

import java.util.ArrayList;

public class ActivityCollector {

    public static List<Activity> activities = new ArrayList<>();

    public staic void addActivity(Activity activity){
        activities.add(activity);
    }

    public static void removeActivity(BaseActivity activity){
        activities.remove(activity);
    }

    public static void finishAll(){
        for(Activity activity:activities){
            if(!activity.isFinishing()){
                activity.finish();
            }
        }
    }
}